<?php

//管理后台
Route::group(['prefix' => 'admin'], function(){
	/*登录展示*/
	Route::get('/login', '\App\Admin\Controllers\LoginController@index');
	/*登录行为*/
	Route::post('/login', '\App\Admin\Controllers\LoginController@login');
	/*登出*/
	Route::get('/logout', '\App\Admin\Controllers\LoginController@logout');

	Route::group(['middleware' => ['auth:admin', 'menu', 'authAdmin']], function () {
		/*首页*/
		Route::get('/home', ['as' => 'admin.index', 'uses' => '\App\Admin\Controllers\HomeController@index']);
		Route::get('/lock_screen', ['as' => 'admin.lock', 'uses' => '\App\Admin\Controllers\HomeController@lockScreen']);
		Route::post('/lock_screen', ['as' => 'admin.lock', 'uses' => '\App\Admin\Controllers\HomeController@unlock']);
		/*管理人员*/
		Route::get('/users', ['as' => 'admin.users.index', 'uses' => '\App\Admin\Controllers\UserController@index']);
		Route::get('/users/search', ['as' => 'admin.users.index', 'uses' => '\App\Admin\Controllers\UserController@index']);
		Route::get('/users/create', ['as' => 'admin.users.create', 'uses' => '\App\Admin\Controllers\UserController@create']);
		Route::get('/users/delete/{user}', ['as' => 'admin.users.create', 'uses' => '\App\Admin\Controllers\UserController@delete']);
		Route::get('/users/batch_delete', ['as' => 'admin.users.create', 'uses' => '\App\Admin\Controllers\UserController@batchDelete']);
		Route::post('/users/store', ['as' => 'admin.users.create', 'uses' => '\App\Admin\Controllers\UserController@store']);
		Route::get('/users/role/{user}', ['as' => 'admin.users.role', 'uses' => '\App\Admin\Controllers\UserController@role']);
		Route::post('/users/role/{user}', ['as' => 'admin.users.role', 'uses' => '\App\Admin\Controllers\UserController@storeRole']);
		/*角色*/
		Route::get('/roles', ['as' => 'admin.roles.index', 'uses' => '\App\Admin\Controllers\RoleController@index']);
		Route::get('/roles/search', ['as' => 'admin.roles.index', 'uses' => '\App\Admin\Controllers\RoleController@index']);
		Route::get('/roles/delete/{role}', ['as' => 'admin.roles.delete', 'uses' => '\App\Admin\Controllers\RoleController@delete']);
		Route::get('/roles/batch_delete', ['as' => 'admin.roles.delete', 'uses' => '\App\Admin\Controllers\RoleController@batchDelete']);
		Route::get('/roles/create', ['as' => 'admin.roles.create', 'uses' => '\App\Admin\Controllers\RoleController@create']);
		Route::post('/roles/store', ['as' => 'admin.roles.create', 'uses' => '\App\Admin\Controllers\RoleController@store']);
		Route::get('/roles/permission/{role}', ['as' => 'admin.roles.permission', 'uses' => '\App\Admin\Controllers\RoleController@permission']);
		Route::post('/roles/permission/{role}', ['as' => 'admin.roles.permission', 'uses' => '\App\Admin\Controllers\RoleController@storePermission']);
		/*权限*/
		Route::get('/permissions', ['as' => 'admin.permissions.index', 'uses' => '\App\Admin\Controllers\PermissionController@index']);
		Route::get('/permissions/search', ['as' => 'admin.permissions.index', 'uses' => '\App\Admin\Controllers\PermissionController@index']);
		Route::get('/permissions/create', ['as' => 'admin.permissions.create', 'uses' => '\App\Admin\Controllers\PermissionController@create']);
		Route::post('/permissions/store', ['as' => 'admin.permissions.create', 'uses' => '\App\Admin\Controllers\PermissionController@store']);
		Route::get('/permissions/edit/{permission}', ['as' => 'admin.permissions.edit', 'uses' => '\App\Admin\Controllers\PermissionController@edit']);
		Route::post('/permissions/edit/{permission}', ['as' => 'admin.permissions.edit', 'uses' => '\App\Admin\Controllers\PermissionController@editStore']);
		Route::get('/permissions/delete/{permission}', ['as' => 'admin.permissions.delete', 'uses' => '\App\Admin\Controllers\PermissionController@delete']);
		Route::get('/permissions/sub_permission/{permission}', ['as' => 'admin.permissions.edit', 'uses' => '\App\Admin\Controllers\PermissionController@subPermission']);
		Route::get('/permissions/sub_search/{permission}', ['as' => 'admin.permissions.edit', 'uses' => '\App\Admin\Controllers\PermissionController@subPermission']);
	});
});


?>